<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">

    <div class="layui-card-body">

        {if isset($vo.pid) and $vo.pid > 0}
        <div class="layui-form-item">
            <label class="layui-form-label label-required">上级{$typedesc|default=''}</label>
            <div class="layui-input-block">
                <input type="hidden" name="pid" value="{$vo.parent.id|default=0}">
                <input value="{$vo.parent.title|default=0}" class="layui-input layui-bg-gray" readonly>
                <p class="help-block"><b>必选</b>，当前所属上级信息，不支持切换和修改，请认真确认再保存</p>
            </div>
        </div>
        {/if}

        <div class="layui-form-item">
            <label class="layui-form-label">{$typedesc|default=''}代码</label>
            <div class="layui-input-block">
                <input name="code" value="{$vo.code|default=''}" required pattern="^\d{6}$" placeholder="请输入6位数字" class="layui-input">
                <p class="help-block"><b>必填</b>，请填写{$typedesc|default=''}代码，请参考国家区域信息填写，需保持唯一</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">{$typedesc|default=''}名称</label>
            <div class="layui-input-block">
                <input name="title" value='{$vo.title|default=""}' required placeholder="请输入区域名称" class="layui-input">
                <p class="help-block"><b>必填</b>，请填写{$typedesc|default=''}名称，填写后尽量不要再修改，需保持唯一</p>
            </div>
        </div>

    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

</form>
